Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 2 - Geometric Shapes / Geometric Shapes Reference
Functions / Editing Shape Geometries


GXCountShapeContours

You can use the GXCountShapeContours function to determine the number of contours in a shape.

long GXCountShapeContours(gxShape source);
source
A reference to the shape whose contours you want to count.
function result
The number of contours in the source shape.
DESCRIPTION
The GXCountShapeContours function returns as its function result the number of contours in the source shape. For polygon and path shapes, this number indicates the total number of polygon contours or path contours contained in the shape. For points, lines, curves, and rectangles, this function returns the value 1. For empty and full shapes, this function posts the graphics_type_does_not_have_multiple_contours error.

If you provide a source shape that is not one of the geometric shape types, this function performs the actions described in the following table:
Shape typeAction taken
bitmapAlways returns 1 as the function result
pictureReturns the number of picture items
textReturns the number of glyphs
glyphReturns the number of glyphs
layoutReturns the byte length of the text

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
graphic_type_does_not_have_multiple_contours(debugging version)
SEE ALSO
For a discussion of contours, see "Shape Geometry" on page 2-9, "Polygon Shapes" on page 2-22, and "Path Shapes" on page 2-25.

To learn how this function works for typographic shape types, see Inside Macintosh: QuickDraw GX Typography.

To determine the number of points in a specific contour of a shape, use the GXCountShapePoints function, which is described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help